#!D:\\Python27\\python
# Filename:using_file.py

poem='''\
Programing is fun
When the work is done
If you wanna make your work also fun:
    use Python!
'''
def input(poem,type):
    f=file('poem.txt',type)
    f.write(poem)
    f.close()

def output():
    f= file('poem.txt')
    #if no mode is specified,'r'ead mode is assumed by default
    while True:
        line = f.readline()
        if len(line) == 0:
            break
        print line,
        #print line
        #different,
        #run up, it will output by file type
        #run down, it will output by add new line type              
    f.close()

input(poem, 'w')
output()

